home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
c
/
teglc.zip
/
TEGLSYS.ZIP
/
TEGLSYS.H
< prev
next >
Wrap
Text File
|
1990-06-29
|
42KB
|
1,421 lines
/*---------------------------------------------------------------------------*
| TEGL Windows ToolKit II |
| Copyright (C) 1990, TEGL Systems Corporation |
| All Rights Reserved. |
*---------------------------------------------------------------------------*/
/* teglcond.h */
/* conditional defines and compatability defines */
/* only define one of these for the compiler */
#define TURBOC
/* #define QUICKC */
#ifdef TURBOC
#ifdef QUICKC
#error Can only define one compiler.
#endif
#endif
#ifndef TURBOC
#ifndef QUICKC
#error No compiler defined.
#endif
#endif
/* #define TRACE */
#ifdef TRACE
#define trace(fmt,itm) printf(fmt,itm); getch()
#else
#define trace(fmt,itm)
#endif
/* define to build the demonstrator version of the library */
#define TEGLDEMO
/* define if the virtual memory manager is NOT to be used */
/* #define NOVIRT */
/* define if the graphics libraries from TURBO C or QUICK C are */
/* not to be used. */
/* #define NOGR */
/* common defines */
#define MK_FP(seg,ofs) ((void far *) \
(((unsigned long)(seg) << 16) | (unsigned)(ofs)))
#ifdef QUICKC
#define random( max ) ((rand() % (int)((max) - (0))) + (0) + 1)
#define poke(a,b,c) (*((int far*) MK_FP((a),(b))) = (int) (c))
#define sound( n )
#define nosound()
#define delay( n )
/* TURBO C's and QUICK C's dos.h are largely compatible */
/* just a few name changes are required. */
#define time dostime_t
#define gettime _dos_gettime
#define ti_sec second
#define dfree diskfree_t
#define df_avail avail_clusters
#define df_total total_clusters
#define df_bsec bytes_per_sector
#define df_sclus sectors_per_cluster
#define findnext _dos_findnext
#define WILDCARDS 0x01
#define EXTENSION 0x02
#define FILENAME 0x04
#define DIRECTORY 0x08
#define DRIVE 0x10
#define MAXPATH 80
#define MAXDRIVE 3
#define MAXDIR 66
#define MAXFILE 9
#define MAXEXT 5
#define FA_RDONLY 0x01 /* Read only attribute */
#define FA_HIDDEN 0x02 /* Hidden file */
#define FA_SYSTEM 0x04 /* System file */
#define FA_LABEL 0x08 /* Volume label */
#define FA_DIREC 0x10 /* Directory */
#define FA_ARCH 0x20 /* Archive */
#endif
#ifndef FALSE
#define FALSE 0
#define TRUE 1
#endif
#ifdef QUICKC
#ifndef NOGR
#define MSGRAPH
#endif
#endif
/* make sure demo defines are correct */
#ifdef TEGLDEMO
#ifndef NOVIRT
#define NOVIRT
#endif
#ifdef TURBOC
#ifdef NOGR
#undef NOGR
#endif
#endif
#endif
/* extendc.c */
extern char *fexpand (char *ipath);
extern void dos_getpath(unsigned char drive, char far *pathname);
extern int appendwildcards(char *FilePath);
/* fastgrph.c */
#define A_ "\xc1"
#define B_ "\xc2"
#define C_ "\xc3"
#define D_ "\xc4"
#define E_ "\xc5"
#define F_ "\xc6"
#define G_ "\xc7"
#define H_ "\xc8"
#define I_ "\xc9"
#define J_ "\xca"
#define K_ "\xcb"
#define L_ "\xcc"
#define M_ "\xcd"
#define N_ "\xce"
#define O_ "\xcf"
#define P_ "\xd0"
#define Q_ "\xd1"
#define R_ "\xd2"
#define S_ "\xd3"
#define T_ "\xd4"
#define U_ "\xd5"
#define V_ "\xd6"
#define W_ "\xd7"
#define X_ "\xd8"
#define Y_ "\xd9"
#define Z_ "\xda"
typedef void (far *vmode)(void);
typedef unsigned masktype[2][16];
typedef void (*fontptr)();
typedef struct vidid {
unsigned char video0type;
unsigned char display0type;
unsigned char video1type;
unsigned char display1type;
} vidid;
#define FGNORM 0x00
#define FGAND 0x08
#define FGOR 0x10
#define FGXOR 0x18
#define FGNOT 0x80
#define TG_MDA 0x01
#define TG_CGA 0x02
#define TG_EGA 0x03
#define TG_MCGA 0x04
#define TG_VGA 0x05
#define TG_HGC 0x80
#define TG_HGCPLUS 0x81
#define TG_INCOLOR 0x82
#define TG_MDADISPLAY 0x01
#define TG_CGADISPLAY 0x02
#define TG_EGACOLORDISPLAY 0x03
#define TG_PS2MONODISPLAY 0x04
#define TG_PS2COLORDISPLAY 0x05
extern unsigned jagged;
extern unsigned rmwbits;
extern unsigned activepage;
extern unsigned mousecolor;
extern unsigned mousehotspot_xofs;
extern unsigned mousehotspot_yofs;
extern unsigned teglfillmask;
extern char videochoicescga640x200x2;
extern char videochoicesega640x350x16;
extern char videochoicesvga640x480x16;
extern char videochoicesherc720x348x2;
extern unsigned char propagatedpixel[16];
extern char proportionalfont;
extern int initdrivercode;
typedef unsigned far (*teglgrfunc01)(unsigned,unsigned);
typedef unsigned far (*teglgrfunc02)(unsigned,unsigned,void*);
typedef unsigned long far (*teglgrfunc03)(unsigned,unsigned,unsigned,unsigned);
typedef void far (*teglgrproc01)(unsigned,unsigned,unsigned,unsigned,unsigned);
typedef void far (*teglgrproc02)(unsigned,unsigned,unsigned);
typedef void far (*teglgrproc03)(unsigned,unsigned,void*,unsigned);
typedef void far (*teglgrproc04)(unsigned,unsigned,unsigned,unsigned,void*);
typedef void far (*teglgrproc05)(unsigned,unsigned,unsigned,unsigned,void*,void*);
typedef void far (*teglgrproc06)(unsigned,unsigned,void*,void*);
typedef void far (*teglgrproc07)(unsigned,unsigned,unsigned,unsigned);
typedef void far (*teglgrproc08)(void);
typedef void far (*teglgrproc09)(unsigned,unsigned);
extern teglgrfunc01 getpixs;
extern teglgrfunc02 extractpixs;
extern teglgrfunc03 bigimagesize;
extern teglgrproc01 fastline;
extern teglgrproc02 putpixs;
extern teglgrproc03 putbiti;
extern teglgrproc04 getbiti;
extern teglgrproc05 extractimg;
extern teglgrproc06 overlayimg;
extern teglgrproc07 teglwrtchar;
extern teglgrproc08 mcursoroff;
extern teglgrproc09 mcursoron;
extern teglgrproc09 msetpos;
/*
extern unsigned getpixs(unsigned x, unsigned y);
extern unsigned extractpixs(unsigned x, unsigned y, void * buffer);
extern unsigned long bigimagesize(unsigned x,unsigned y,unsigned x1,unsigned y1);
extern void fastline(unsigned x, unsigned y, unsigned x1, unsigned y2, unsigned n);
extern void putpixs(unsigned x, unsigned y, unsigned n);
extern void putbiti(unsigned x, unsigned y, void * buffer, unsigned rmwbits);
extern void getbiti(unsigned x, unsigned y, unsigned x1, unsigned y1, void * buffer);
extern void extractimg(unsigned x, unsigned y, unsigned x1, unsigned y1, void * buff1, void * buff2);
extern void overlayimg(unsigned x, unsigned y, void * buff1, void * buff2);
extern void teglwrtchar(int c,int x,int y,int color);
extern void mcursoroff(void);
extern void mcursoron(unsigned xpos,unsigned ypos);
extern void msetpos(unsigned xpos,unsigned ypos);
*/
extern void putpict(unsigned x, unsigned y, unsigned char *buf, unsigned n);
extern void pictsize(unsigned * w, unsigned * h, unsigned char *buf);
extern void swapbytes(void * buff1, void * buff2, long bytestoswap);
extern int teglcharwidth(int c);
extern int teglcharheight(void);
extern void videoid(vidid far * v);
extern int tegltextwidth(char * mystr);
extern void outtegltextxy(int x,int y,char *mystr);
extern void fmttegltextxy(int x, int y, char *format,...);
#define setproportional(onoff) proportionalfont = onoff
#define setteglfont(f) fonttable = f
extern void xorcornerbox(int x, int y, int x1, int y1, int color);
extern void xorbox(int x, int y, int x1, int y1, int color);
extern void flipapage(void);
extern void flipvpage(void);
extern void setapage(unsigned pagenum);
extern void setvpage(unsigned pagenum);
extern unsigned videopage(void);
extern void abort_msg(char * msg);
extern void ega640x350x16(void);
extern void vga640x480x16(void);
extern void herc720x348x2(void);
extern void cga640x200x2(void);
extern void videoautodetect(void);
extern char * videomodestring(char vtype, char dtype);
extern void setvideochoices(unsigned v, char accept);
extern fontptr fonttable;
extern unsigned evgagetpixs(unsigned x,unsigned y);
extern unsigned evgaextractpixs(unsigned x,unsigned y,void * buffer);
extern unsigned long evgaimagesize(unsigned x,unsigned y,unsigned x1,unsigned y1);
extern void evgafastline(unsigned x,unsigned y,unsigned x1,unsigned y2,unsigned